package com.st.buy.search.mqrevice;

import com.st.buy.search.service.SearchService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 张双虎
 */
@Component
public class ItemAddRevice {
    @Autowired
    private SearchService searchService;
    @RabbitListener(queues = "item-add-search")
    public void addSearch(String msg){
        if(StringUtils.isNoneBlank(msg)){
            //具体的导入方法在service
            searchService.importIndex(new Long(msg));
        }
    }
}
